package queries;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Class for representing search results
 * 
 * @author Vika
 * @author ak2765
 */
public class DocumentSample {

	private String nextResultUrl;
	
	private Set<Document> documents = new HashSet<Document>();

	public Set<Document> getDocuments() {
		return Collections.unmodifiableSet(documents);
	}

	public String getNextResultUrl() {
		return nextResultUrl;
	}

	public void setNextResultUrl(String nextResultUrl) {
		this.nextResultUrl = nextResultUrl;
	}

	public void addDocument(Document document) {
		this.documents.add(document);
	}
	
	@Override
	public String toString() {
		StringBuilder buff = new StringBuilder();
		buff.append("DocumentSample[nextResultUrl=").append(this.nextResultUrl);
		
		buff.append(", pages=[");
		for(Document doc : this.documents) {
			buff.append("\n\t[");
			buff.append(doc.toString());
			buff.append("]");
		}
		
		return buff.toString();
	}
}
